{% case include.type %}
  {% when "windows" %}
  {% assign name = "OpenRA-" | append: include.release.tag_name | append: "-x64.exe" %}
  {% when "macos" %}
  {% assign name = "OpenRA-" | append: include.release.tag_name | append: ".dmg" %}
  {% when "appimage" %}
  {% assign name = "OpenRA-" | append: include.appimagename | append: "-x86_64.AppImage" %}
  {% when "source" %}
  {% assign name = "OpenRA-" | append: include.release.tag_name | append: "-source.tar.bz2" %}
{% endcase %}
{% assign asset = include.release.assets | where: "name", name | first %}

<a
  href="{{ asset.browser_download_url }}"
  class="
    instruction__download-button
    {% if include.playtest %}
    instruction__download-button--playtest
    button--construction
      {% unless include.release.tag_name %}
      button--disabled
      {% endunless %}
    {% else %}
    instruction__download-button--release
    {% endif %}
    button button--large button--primary">
  {% if include.text %}
    {{ include.text }}
  {% else %}
    {% if include.playtest %}
      下载测试版
    {% else %}
      下载发布版
    {% endif %}
  {% endif %}
  {% if include.icon %}
    <img class="button__icon icon" src="{{ include.icon | relative_url }}" />
  {% else %}
    <svg class="button__icon icon">
      <use xlink:href="{{ '/images/icons/icons.svg#icon-download' | relative_url }}"></use>
    </svg>
  {% endif %}
  <span class="instruction__download-button__release badge">
    {% if include.release.tag_name %}
      {{include.release.tag_name}} ({{ asset.size | divided_by: 1048576.0 | round: 2 }}MB)
    {% else %}
      No Playtest Available
    {% endif %}
    </span>
</a>